package com.itheima.reggie.controllerApi;

import com.itheima.reggie.pojo.Category;
import com.itheima.reggie.pojo.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * Created by ZhaoJun on 2021/12/8 15:16
 */
@Api(description = "分类管理相关接口")
public interface CategoryControllerApi {

    @ApiOperation("添加菜品或者套餐的分类")
    @ApiImplicitParam(name = "category", value = "分类信息", required = true)
    R addCategory(@RequestBody Category category);

    @ApiOperation("分页查询分类的信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "page", value = "页码", required = true),
            @ApiImplicitParam(name = "pageSize", value = "页面条目数", required = true)
    })
    R page(Integer page, Integer pageSize);

    @ApiOperation("根据分类id删除分类信息")
    @ApiImplicitParam(name = "id", value = "分类ID", required = true)
    R delById(Long id);

    @ApiOperation("根据分类id修改分类的信息")
    @ApiImplicitParam(name = "category", value = "分类信息", required = true)
    R updateById(@RequestBody Category category);

    @ApiOperation("根据分类的类型查询所有对应的分类")
    @ApiImplicitParam(name = "type", value = "分类类型", required = true)
    R selectByType(Integer type);


}
